"use server";

import { query } from "@/utils/mysql2";
import { User } from "./user";

export const DB_Query_UserInfo = async (
  id?: number
): Promise<DatabaseApi.Response<User[]>> =>
  id
    ? await query("SELECT * FROM `user` WHERE `id` = ? ", [id])
    : await query("SELECT * FROM `user`");
